package com.dayuanit.dy15.lesson20.demo2;

import java.util.LinkedList;

public class Test2 {

    public static void main(String[] args) {
        LinkedList link = new LinkedList();
        link.add("tom");
        link.add("jack");
        link.add("bob");

        System.out.println(link.get(1));

        System.out.println("--------------");

        link.remove(1);

        for (int i=0; i<link.size(); i ++) {
            System.out.println(link.get(i));
        }
        System.out.println("--------------");


        link.set(1, "bob2");

        for (int i=0; i<link.size(); i ++) {
            System.out.println(link.get(i));
        }

        System.out.println("-----------------");
        link.remove("tom");

        for (int i=0; i<link.size(); i ++) {
            System.out.println(link.get(i));
        }


    }
}
